package com.example.makerspace.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.makerspace.domain.OnlineUserListDO;

import com.example.makerspace.mapper.OnlineUserListMapper;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.concurrent.DelayQueue;

@Component
public class OnlineUserListDAO extends  BaseDAO<OnlineUserListDO>{

        @Resource
        private OnlineUserListMapper onlineUserListMapper;

        @PostConstruct
        public void init(){
            this.mapper = onlineUserListMapper;
        }

    public void deleteByUserName(String username) {
        QueryWrapper<OnlineUserListDO> wrapper = new QueryWrapper<>();
        wrapper.eq("username",username);
        mapper.delete(wrapper);
    }
}
